package com.wb.mas.ui.login;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.gyf.immersionbar.ImmersionBar;
import com.wb.mas.BR;
import com.wb.mas.R;
import com.wb.mas.app.AppViewModelFactory;
import com.wb.mas.databinding.ActLoginAccountBinding;

import me.goldze.mvvmhabit.base.BaseActivity;

public class LoginAccountActivity extends BaseActivity<ActLoginAccountBinding, LoginAccountModel> {


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.act_login_account;
    }

    @Override
    protected void initStatusBar() {
        ImmersionBar.with(this)
                .navigationBarColor(R.color.transparent)
                .init();  //必须调用方可沉浸式
    }
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public LoginAccountModel initViewModel() {
        //使用自定义的ViewModelFactory来创建ViewModel，如果不重写该方法，则默认会调用LoginViewModel(@NonNull Application application)构造方法
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(LoginAccountModel.class);
    }
}
